package com.sskj.b70.p.fragment;

import com.lzy.okgo.model.Response;
import com.sskj.b70.m.bean.Banner;
import com.sskj.b70.m.bean.HaiPageBean;
import com.sskj.b70.m.bean.HttpData;
import com.sskj.b70.m.bean.NoticeList;
import com.sskj.b70.m.http.JsonCallBack;
import com.sskj.b70.p.base.BasePresenter;
import com.sskj.b70.v.fragment.MarketBannerFragment;

import java.util.List;

public class MarketBannerFragmentPst extends BasePresenter<MarketBannerFragment> {

    public void getBannerUrl() {
        httpService.getBannerImage().execute(new JsonCallBack<HttpData<Banner>>(this) {
            @Override
            protected void _onSuccess(Response<HttpData<Banner>> response) {
                mView.showBanner(response.body().getData());
            }
        });
    }

    public void getNotice() {
        httpService.getGGList(1)
                .execute(new JsonCallBack<HttpData<HaiPageBean<NoticeList>>>() {
                    @Override
                    protected void _onSuccess(Response<HttpData<HaiPageBean<NoticeList>>> response) {
                        mView.setNotice(response.body().getData().getRes());
                    }
                });
    }

}
